.class public Les/n70;
.super Les/s80;
.source "PlayToTask.java"


# instance fields
.field private D:Lcom/estrongs/fs/g;

.field private E:Ljava/lang/String;

.field private F:Ljava/net/InetAddress;

.field G:Landroid/content/Context;


# direct methods
.method constructor <init>(Landroid/content/Context;Lcom/estrongs/fs/g;Ljava/lang/String;)V
    .locals 1

    .line 1
    invoke-direct {p0}, Les/s80;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-object v0, p0, Les/n70;->F:Ljava/net/InetAddress;

    .line 3
    iput-object p1, p0, Les/n70;->G:Landroid/content/Context;

    .line 4
    iput-object p2, p0, Les/n70;->D:Lcom/estrongs/fs/g;

    .line 5
    iput-object p3, p0, Les/n70;->E:Ljava/lang/String;

    const/16 p1, 0x3a

    .line 6
    invoke-virtual {p3, p1}, Ljava/lang/String;->indexOf(I)I

    move-result p1

    .line 7
    iget-object p2, p0, Les/n70;->E:Ljava/lang/String;

    const/4 p3, 0x0

    invoke-virtual {p2, p3, p1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Les/n70;->E:Ljava/lang/String;

    .line 8
    iput-boolean p3, p0, Les/s80;->w:Z

    .line 9
    iput-boolean p3, p0, Les/s80;->u:Z

    const/4 p2, 0x5

    .line 10
    iput p2, p0, Les/s80;->s:I

    .line 11
    :try_start_0
    invoke-static {p1}, Ljava/net/InetAddress;->getByName(Ljava/lang/String;)Ljava/net/InetAddress;

    move-result-object p1

    iput-object p1, p0, Les/n70;->F:Ljava/net/InetAddress;
    :try_end_0
    .catch Ljava/net/UnknownHostException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception p1

    .line 12
    invoke-virtual {p1}, Ljava/net/UnknownHostException;->printStackTrace()V

    :goto_0
    return-void
.end method

.method public static D()V
    .locals 0

    .line 1
    invoke-static {}, Les/lj;->e()V

    return-void
.end method

.method public static a(Landroid/content/Context;Lcom/estrongs/fs/g;Ljava/lang/String;)Les/n70;
    .locals 1

    .line 6
    new-instance v0, Les/n70;

    invoke-direct {v0, p0, p1, p2}, Les/n70;-><init>(Landroid/content/Context;Lcom/estrongs/fs/g;Ljava/lang/String;)V

    .line 7
    new-instance p0, Les/n70$a;

    invoke-direct {p0}, Les/n70$a;-><init>()V

    invoke-virtual {v0, p0}, Les/s80;->a(Les/z80;)V

    .line 8
    invoke-static {}, Les/ij;->g()Z

    move-result p0

    if-nez p0, :cond_0

    const/4 p0, 0x0

    return-object p0

    .line 9
    :cond_0
    invoke-virtual {v0}, Les/s80;->d()V

    return-object v0
.end method


# virtual methods
.method public C()Ljava/net/InetAddress;
    .locals 1

    .line 1
    iget-object v0, p0, Les/n70;->F:Ljava/net/InetAddress;

    return-object v0
.end method

.method public varargs a(I[Ljava/lang/Object;)V
    .locals 3

    const/4 v0, 0x2

    if-eq p1, v0, :cond_0

    .line 1
    invoke-super {p0, p1, p2}, Les/s80;->a(I[Ljava/lang/Object;)V

    goto :goto_0

    .line 2
    :cond_0
    iget-object p1, p0, Les/s80;->c:Les/w80$a;

    const/4 v1, 0x0

    aget-object v1, p2, v1

    check-cast v1, Ljava/lang/Long;

    invoke-virtual {v1}, Ljava/lang/Long;->longValue()J

    move-result-wide v1

    iput-wide v1, p1, Les/w80$a;->f:J

    .line 3
    iget-object p1, p0, Les/s80;->c:Les/w80$a;

    const/4 v1, 0x1

    aget-object v1, p2, v1

    check-cast v1, Ljava/lang/String;

    iput-object v1, p1, Les/w80$a;->a:Ljava/lang/String;

    .line 4
    aget-object p2, p2, v0

    check-cast p2, Ljava/lang/Long;

    invoke-virtual {p2}, Ljava/lang/Long;->longValue()J

    move-result-wide v0

    iput-wide v0, p1, Les/w80$a;->e:J

    .line 5
    iget-object p1, p0, Les/s80;->c:Les/w80$a;

    invoke-virtual {p0, p1}, Les/s80;->a(Les/w80$a;)V

    :goto_0
    return-void
.end method

.method public y()Z
    .locals 16

    move-object/from16 v1, p0

    const-string v0, "."

    .line 1
    iget-object v2, v1, Les/n70;->E:Ljava/lang/String;

    iget-object v3, v1, Les/n70;->D:Lcom/estrongs/fs/g;

    invoke-static {v2, v3}, Les/lj;->a(Ljava/lang/String;Lcom/estrongs/fs/g;)V

    .line 2
    iget-object v2, v1, Les/s80;->c:Les/w80$a;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Playing media file for "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v4, v1, Les/n70;->E:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    iput-object v3, v2, Les/w80$a;->a:Ljava/lang/String;

    .line 3
    iget-object v2, v1, Les/s80;->c:Les/w80$a;

    invoke-virtual {v1, v2}, Les/s80;->a(Les/w80$a;)V

    .line 4
    invoke-static {}, Les/s80;->A()Les/s80;

    move-result-object v2

    const/4 v3, 0x0

    const/16 v4, 0x2710

    const/4 v5, 0x0

    .line 5
    :try_start_0
    iget-object v6, v1, Les/n70;->E:Ljava/lang/String;

    invoke-static {v6}, Ljava/net/InetAddress;->getByName(Ljava/lang/String;)Ljava/net/InetAddress;

    move-result-object v6

    .line 6
    new-instance v7, Ljava/net/Socket;

    invoke-direct {v7}, Ljava/net/Socket;-><init>()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_2

    .line 7
    :try_start_1
    new-instance v8, Ljava/net/InetSocketAddress;

    sget v9, Les/c90;->g:I

    invoke-direct {v8, v6, v9}, Ljava/net/InetSocketAddress;-><init>(Ljava/net/InetAddress;I)V

    invoke-virtual {v7, v8, v4}, Ljava/net/Socket;->connect(Ljava/net/SocketAddress;I)V

    .line 8
    invoke-virtual {v7, v4}, Ljava/net/Socket;->setSoTimeout(I)V

    .line 9
    invoke-virtual {v7}, Ljava/net/Socket;->isConnected()Z

    move-result v6

    if-eqz v6, :cond_9

    .line 10
    new-instance v6, Ljava/io/DataInputStream;

    invoke-virtual {v7}, Ljava/net/Socket;->getInputStream()Ljava/io/InputStream;

    move-result-object v8

    invoke-direct {v6, v8}, Ljava/io/DataInputStream;-><init>(Ljava/io/InputStream;)V

    .line 11
    new-instance v8, Ljava/io/DataOutputStream;

    invoke-virtual {v7}, Ljava/net/Socket;->getOutputStream()Ljava/io/OutputStream;

    move-result-object v9

    invoke-direct {v8, v9}, Ljava/io/DataOutputStream;-><init>(Ljava/io/OutputStream;)V

    .line 12
    iget-object v9, v1, Les/n70;->G:Landroid/content/Context;

    invoke-static {v9}, Les/m70;->b(Landroid/content/Context;)[B

    move-result-object v9

    .line 13
    aget-byte v10, v9, v5

    if-ltz v10, :cond_0

    aget-byte v10, v9, v5

    goto :goto_0

    :cond_0
    aget-byte v10, v9, v5

    add-int/lit16 v10, v10, 0x100

    :goto_0
    const/4 v11, 0x1

    .line 14
    aget-byte v12, v9, v11

    if-ltz v12, :cond_1

    aget-byte v12, v9, v11

    goto :goto_1

    :cond_1
    aget-byte v12, v9, v11

    add-int/lit16 v12, v12, 0x100

    :goto_1
    const/4 v13, 0x2

    .line 15
    aget-byte v14, v9, v13

    if-ltz v14, :cond_2

    aget-byte v13, v9, v13

    goto :goto_2

    :cond_2
    aget-byte v13, v9, v13

    add-int/lit16 v13, v13, 0x100

    :goto_2
    const/4 v14, 0x3

    .line 16
    aget-byte v15, v9, v14

    if-ltz v15, :cond_3

    aget-byte v9, v9, v14

    goto :goto_3

    :cond_3
    aget-byte v9, v9, v14

    add-int/lit16 v9, v9, 0x100

    .line 17
    :goto_3
    new-instance v14, Ljava/lang/StringBuilder;

    invoke-direct {v14}, Ljava/lang/StringBuilder;-><init>()V

    const-string v15, "MYPOST "

    invoke-virtual {v14, v15}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v15, v1, Les/n70;->D:Lcom/estrongs/fs/g;

    invoke-interface {v15}, Lcom/estrongs/fs/g;->d()Ljava/lang/String;

    move-result-object v15

    invoke-virtual {v14, v15}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v15, " HTTP/1.1\r\nConnection: Keep-Alive\r\nContent-Type: media/realtime\r\nContent-Length: "

    invoke-virtual {v14, v15}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v15, v1, Les/n70;->D:Lcom/estrongs/fs/g;

    .line 18
    invoke-interface {v15}, Lcom/estrongs/fs/g;->length()J

    move-result-wide v4

    invoke-virtual {v14, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v4, "\r\nUser-Agent: Dalvik\r\nHost: "

    invoke-virtual {v14, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v14, v10}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v14, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v14, v12}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v14, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v14, v13}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v14, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v14, v9}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v0, ":"

    invoke-virtual {v14, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 19
    invoke-static {}, Les/ij;->f()I

    move-result v0

    invoke-virtual {v14, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v0, "\r\n\r\n"

    invoke-virtual {v14, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v14}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v4, "utf-8"

    .line 20
    invoke-virtual {v0, v4}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v0

    invoke-virtual {v8, v0}, Ljava/io/DataOutputStream;->write([B)V

    .line 21
    :cond_4
    invoke-virtual {v6}, Ljava/io/DataInputStream;->available()I

    move-result v0

    if-nez v0, :cond_5

    const-wide/16 v4, 0xc8

    .line 22
    invoke-static {v4, v5}, Ljava/lang/Thread;->sleep(J)V

    if-eqz v2, :cond_4

    .line 23
    invoke-virtual {v2}, Les/s80;->z()Z

    move-result v0

    if-eqz v0, :cond_4

    .line 24
    new-instance v0, Les/u80$a;

    const-string v2, "You canceled transfering."

    invoke-direct {v0, v2, v3}, Les/u80$a;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V

    const/16 v2, 0x2710

    invoke-virtual {v1, v2, v0}, Les/s80;->b(ILjava/lang/Object;)V

    .line 25
    invoke-virtual {v7}, Ljava/net/Socket;->close()V

    .line 26
    iget-object v0, v1, Les/n70;->E:Ljava/lang/String;

    iget-object v2, v1, Les/n70;->D:Lcom/estrongs/fs/g;

    invoke-static {v0, v2}, Les/lj;->b(Ljava/lang/String;Lcom/estrongs/fs/g;)V

    const/4 v2, 0x0

    return v2

    .line 27
    :cond_5
    new-instance v0, Ljava/util/Properties;

    invoke-direct {v0}, Ljava/util/Properties;-><init>()V

    const-string v2, ""

    .line 28
    :cond_6
    :goto_4
    invoke-virtual {v6}, Ljava/io/DataInputStream;->readLine()Ljava/lang/String;

    move-result-object v4

    .line 29
    invoke-virtual {v4}, Ljava/lang/String;->length()I

    move-result v5

    if-nez v5, :cond_8

    .line 30
    sget-object v4, Ljava/lang/System;->out:Ljava/io/PrintStream;

    invoke-virtual {v4, v2}, Ljava/io/PrintStream;->print(Ljava/lang/String;)V

    const-string v2, "content-length"

    .line 31
    invoke-virtual {v0, v2}, Ljava/util/Properties;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    new-array v0, v0, [B

    .line 32
    invoke-virtual {v6, v0}, Ljava/io/DataInputStream;->read([B)I

    .line 33
    new-instance v2, Ljava/lang/String;

    invoke-direct {v2, v0}, Ljava/lang/String;-><init>([B)V

    const-string v0, "OK"

    .line 34
    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_7

    .line 35
    new-instance v0, Les/u80$a;

    const-string v2, "Receiver rejected."

    invoke-direct {v0, v2, v3}, Les/u80$a;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V

    const/16 v2, 0x2710

    invoke-virtual {v1, v2, v0}, Les/s80;->b(ILjava/lang/Object;)V

    .line 36
    invoke-virtual {v7}, Ljava/net/Socket;->close()V

    .line 37
    iget-object v0, v1, Les/n70;->E:Ljava/lang/String;

    iget-object v2, v1, Les/n70;->D:Lcom/estrongs/fs/g;

    invoke-static {v0, v2}, Les/lj;->b(Ljava/lang/String;Lcom/estrongs/fs/g;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    const/4 v2, 0x0

    return v2

    .line 38
    :cond_7
    :try_start_2
    invoke-virtual {v7}, Ljava/net/Socket;->close()V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    :catch_0
    return v11

    .line 39
    :cond_8
    :try_start_3
    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v5, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v5, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v2, "\r\n\'"

    invoke-virtual {v5, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    const/16 v5, 0x3a

    .line 40
    invoke-virtual {v4, v5}, Ljava/lang/String;->indexOf(I)I

    move-result v5

    if-ltz v5, :cond_6

    const/4 v8, 0x0

    .line 41
    invoke-virtual {v4, v8, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v9}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v8

    add-int/lit8 v5, v5, 0x1

    invoke-virtual {v4, v5}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v0, v8, v4}, Ljava/util/Properties;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_4

    .line 42
    :cond_9
    new-instance v0, Ljava/lang/Exception;

    const-string v2, "connect timeout!"

    invoke-direct {v0, v2}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V

    throw v0
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_1

    :catch_1
    move-exception v0

    move-object v3, v7

    goto :goto_5

    :catch_2
    move-exception v0

    .line 43
    :goto_5
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 44
    new-instance v2, Les/u80$a;

    const-string v4, "Connection closed."

    invoke-direct {v2, v4, v0}, Les/u80$a;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V

    const/16 v4, 0x2710

    invoke-virtual {v1, v4, v2}, Les/s80;->b(ILjava/lang/Object;)V

    .line 45
    :try_start_4
    invoke-virtual {v3}, Ljava/net/Socket;->close()V
    :try_end_4
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_3

    .line 46
    :catch_3
    iget-object v0, v1, Les/n70;->E:Ljava/lang/String;

    iget-object v2, v1, Les/n70;->D:Lcom/estrongs/fs/g;

    invoke-static {v0, v2}, Les/lj;->b(Ljava/lang/String;Lcom/estrongs/fs/g;)V

    const/4 v2, 0x0

    return v2
.end method
